/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/07/15
* File: DeviceWin32.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#ifndef DeviceWin32_h__
#define DeviceWin32_h__

#include "Device.h"
#include "../Config/Config.h"

class DeviceWin32 : public Device, RenderTargetListener
{
public:
	DeviceWin32(const CreateDeviceParams& param);

	~DeviceWin32();

	bool run();

	RenderSystem* getRenderSystem() const;

	SceneManager* getSceneManager() const;

	RenderWindow* getRenderWindow() const;

	InputSystem* getInputSystem() const;

	void onViewportUpdate(const Recti& view_port);

	void swap();

protected:
	bool initDevice();
	bool createRenderSystem();
	bool createSceneManager();
	bool createRenderWindow();
	bool createOGLContext();
	bool createInputSystem();

protected:
	CreateDeviceParams			_create_params;
	RenderSystem*				_render_system;
	SceneManager*				_scene_manager;
	RenderWindow*				_render_window;
	InputSystem*				_input_system;
	HGLRC						_ogl_rc;
};

#endif	/* DeviceWin32_h__ */